# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.CloudIdentity.V1.Model.InboundSsoAssignment do
  @moduledoc """
  Targets with "set" SSO assignments and their respective assignments.

  ## Attributes

  *   `customer` (*type:* `String.t`, *default:* `nil`) - Immutable. The customer. For example: `customers/C0123abc`.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. [Resource name](https://cloud.google.com/apis/design/resource_names) of the Inbound SSO Assignment.
  *   `rank` (*type:* `integer()`, *default:* `nil`) - Must be zero (which is the default value so it can be omitted) for assignments with `target_org_unit` set and must be greater-than-or-equal-to one for assignments with `target_group` set.
  *   `samlSsoInfo` (*type:* `GoogleApi.CloudIdentity.V1.Model.SamlSsoInfo.t`, *default:* `nil`) - SAML SSO details. Must be set if and only if `sso_mode` is set to `SAML_SSO`.
  *   `signInBehavior` (*type:* `GoogleApi.CloudIdentity.V1.Model.SignInBehavior.t`, *default:* `nil`) - Assertions about users assigned to an IdP will always be accepted from that IdP. This controls whether/when Google should redirect a user to the IdP. Unset (defaults) is the recommended configuration.
  *   `ssoMode` (*type:* `String.t`, *default:* `nil`) - Inbound SSO behavior.
  *   `targetGroup` (*type:* `String.t`, *default:* `nil`) - Immutable. Must be of the form `groups/{group}`.
  *   `targetOrgUnit` (*type:* `String.t`, *default:* `nil`) - Immutable. Must be of the form `orgUnits/{org_unit}`.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :customer => String.t() | nil,
          :name => String.t() | nil,
          :rank => integer() | nil,
          :samlSsoInfo => GoogleApi.CloudIdentity.V1.Model.SamlSsoInfo.t() | nil,
          :signInBehavior => GoogleApi.CloudIdentity.V1.Model.SignInBehavior.t() | nil,
          :ssoMode => String.t() | nil,
          :targetGroup => String.t() | nil,
          :targetOrgUnit => String.t() | nil
        }

  field(:customer)
  field(:name)
  field(:rank)
  field(:samlSsoInfo, as: GoogleApi.CloudIdentity.V1.Model.SamlSsoInfo)
  field(:signInBehavior, as: GoogleApi.CloudIdentity.V1.Model.SignInBehavior)
  field(:ssoMode)
  field(:targetGroup)
  field(:targetOrgUnit)
end

defimpl Poison.Decoder, for: GoogleApi.CloudIdentity.V1.Model.InboundSsoAssignment do
  def decode(value, options) do
    GoogleApi.CloudIdentity.V1.Model.InboundSsoAssignment.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.CloudIdentity.V1.Model.InboundSsoAssignment do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
